<% layout( 'admin_layout') -%>

<div id="wrapper" class="wrapper">
	<nav class="navbar"  style="background-color: #3BBFB4;">
		<div class="container-fluid">
			<div class="raw">
				<div class="col-sm-6 col-xs-6">
					<h3 style="margin-left:50px;color:#fff;">用户列表</h3>
				</div>
				
			</div>
		</div>
	</nav>
</div>

<div class="container-fulid">

	<section class="content-wrap">
		<div class="container">
			<div class="raw" id="bodycontent">
				<main id="content" class="main-content" role="main">
					<div class ="col-sm-12">
						<h3>已加入的用户</h3>
						<hr/>
					</div>
					<div class="col-sm-12">
						<ul id ="userlist" class="list-group">
							<%for(var i = 0;i<users.length;i++){%>
							<% var lastActivity = new Date(users[i].lastActivity); %>
                			<% lastActivitystr = lastActivity.Format("yyyy年MM月dd日"); %>
                			<% lastActivitystr = (lastActivitystr == '1970年01月01日' ? '0000年00月00日' : lastActivitystr); %>
							<%
								var post = '普通用户';
								if(users[i].group == 'admin'){
									post = '博客所有者';
								}
							%>
							<li class="list-group-item list-group-item-success">
								<span class="badge"><%=post%></span>
								<a href="/admin/userdata/<%=users[i]._id%>">
									
								
									<div>
										<%if(users[i].avatar != ''){%>
										<img src="<%=users[i].avatar%>" class="img-circle" alt="Cinque Terre" width="50" height="50" >
										<%}%>
										<p class="form-control-static"><%=users[i].nickname%><span class="label label-success">最后一次登录:<%=lastActivitystr%></span></p>
									
									</div>
								</a>
							</li>
							<%}%>
							
						</ul>
					</div>
					
					
					
				</main>
			</div>
		</section>
	</div>

<script>
  var menu = new Menu;

  $(function(){
    $("#userlist li").hover(function() {
   // $("#orderedlist li:last").hover(function() {
     $(this).addClass("active");
   }, function() {
    $(this).removeClass("active");
   });
  })
</script>
